﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UFPE.CIn.Abc.Primality.Util;
using System.Diagnostics;

namespace UFPE.CIn.Abc.Primality.Algorithms
{
    public class BailliePSW : BaseAlgorithm
    {
        public override string AlgorithmName
        {
            get
            {
                return "Baillie-PSW";
            }
        }

        private static BailliePSW instance;
        
        public static BailliePSW Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new BailliePSW();
                }

                return instance;
            }
        }

        public override bool Helper(BigInteger thisVal)
        {
            return MillerRabin.Instance.Helper(thisVal, 0) && LucasSelfridge.Instance.Helper(thisVal);
        }
    }
}
